gnss26 2.2.0
Loading...
Searching...
No Matches
gnss26.h File Reference

This file contains API for GNSS 26 Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_uart.h"
#include "drv_i2c_master.h"

Go to the source code of this file.

Data Structures

struct  gnss26_s
 GNSS 26 Click context object. More...
struct  gnss26_cfg_t
 GNSS 26 Click configuration object. More...

Macros

#define GNSS26_RSP_START   "$"
 GNSS 26 response buffer commands.
#define GNSS26_RSP_DELIMITER   ","
#define GNSS26_RSP_END   "\r\n"
#define GNSS26_RSP_GGA   "GGA"
#define GNSS26_DUMMY   0xFF
 GNSS 26 dummy data.
#define GNSS26_GGA_ELEMENT_SIZE   15
 GNSS 26 GGA command elements.
#define GNSS26_GGA_TIME   1
#define GNSS26_GGA_LATITUDE   2
#define GNSS26_GGA_LATITUDE_SIDE   3
#define GNSS26_GGA_LONGITUDE   4
#define GNSS26_GGA_LONGITUDE_SIDE   5
#define GNSS26_GGA_QUALITY_INDICATOR   6
#define GNSS26_GGA_NUMBER_OF_SATELLITES   7
#define GNSS26_GGA_H_DILUTION_OF_POS   8
#define GNSS26_GGA_ALTITUDE   9
#define GNSS26_GGA_ALTITUDE_UNIT   10
#define GNSS26_GGA_GEOIDAL_SEPARATION   11
#define GNSS26_GGA_GEOIDAL_SEPARATION_UNIT   12
#define GNSS26_GGA_TIME_SINCE_LAST_DGPS   13
#define GNSS26_GGA_DGPS_REFERENCE_STATION_ID   14
#define GNSS26_I2C_SLAVE_CR_CMD   0xAA51u
 GNSS 26 I2C settings.
#define GNSS26_I2C_SLAVE_CW_CMD   0xAA53u
#define GNSS26_I2C_SLAVE_CMD_LEN   8
#define GNSS26_I2C_SLAVE_RX_LEN   4
#define GNSS26_I2C_SLAVE_TX_LEN_REG_OFFSET   0x0008u
#define GNSS26_I2C_SLAVE_TX_BUF_REG_OFFSET   0x2000u
#define GNSS26_I2C_SLAVE_RX_LEN_REG_OFFSET   0x0004u
#define GNSS26_I2C_SLAVE_RX_BUF_REG_OFFSET   0x1000u
#define GNSS26_I2C_SLAVE_ADDRESS_CR_OR_CW   0x50
#define GNSS26_I2C_SLAVE_ADDRESS_R   0x54
#define GNSS26_I2C_SLAVE_ADDRESS_W   0x58
#define GNSS26_I2C_SLAVE_MAX_ERRORS   10
#define GNSS26_TX_DRV_BUFFER_SIZE   100
 GNSS 26 driver buffer size.
#define GNSS26_RX_DRV_BUFFER_SIZE   800
#define GNSS26_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.

Typedefs

typedef err_t(* gnss26_master_io_t) (struct gnss26_s *, uint8_t *, uint16_t)
typedef struct gnss26_s gnss26_t
 GNSS 26 Click context object.

Enumerations

enum  gnss26_drv_t { GNSS26_DRV_SEL_UART , GNSS26_DRV_SEL_I2C }
 GNSS 26 Click driver selector. More...
enum  gnss26_return_value_t { GNSS26_OK = 0 , GNSS26_ERROR = -1 }
 GNSS 26 Click return value data. More...

Functions

void gnss26_cfg_setup (gnss26_cfg_t *cfg)
 GNSS 26 configuration object setup function.
void gnss26_drv_interface_sel (gnss26_cfg_t *cfg, gnss26_drv_t drv_sel)
 GNSS 26 driver interface setup function.
err_t gnss26_init (gnss26_t *ctx, gnss26_cfg_t *cfg)
 GNSS 26 initialization function.
err_t gnss26_generic_write (gnss26_t *ctx, uint8_t *data_in, uint16_t len)
 GNSS 26 data writing function.
err_t gnss26_generic_read (gnss26_t *ctx, uint8_t *data_out, uint16_t len)
 GNSS 26 data reading function.
uint8_t gnss26_get_pps_pin (gnss26_t *ctx)
 GNSS 26 get PPS pin function.
void gnss26_set_rst_pin (gnss26_t *ctx, uint8_t state)
 GNSS 26 set RST pin function.
void gnss26_reset_device (gnss26_t *ctx)
 GNSS 26 reset device function.
err_t gnss26_parse_gga (uint8_t *rsp_buf, uint8_t gga_element, uint8_t *element_data)
 GNSS 26 parse GGA function.

Detailed Description

This file contains API for GNSS 26 Click Driver.

Typedef Documentation

◆ gnss26_master_io_t

typedef err_t(* gnss26_master_io_t) (struct gnss26_s *, uint8_t *, uint16_t)

Driver serial interface.

◆ gnss26_t

typedef struct gnss26_s gnss26_t

GNSS 26 Click context object.

Context object definition of GNSS 26 Click driver.

Enumeration Type Documentation

◆ gnss26_drv_t

GNSS 26 Click driver selector.

Selects target driver interface of GNSS 26 Click driver.

Enumerator
GNSS26_DRV_SEL_UART 

UART driver descriptor.

GNSS26_DRV_SEL_I2C 

I2C driver descriptor.

◆ gnss26_return_value_t

GNSS 26 Click return value data.

Predefined enum values for driver return values.

Enumerator
GNSS26_OK 
GNSS26_ERROR